

#ifndef COUTMUTEX_H_
#define COUTMUTEX_H_

#include <memory>
#include <mutex>

/**
 * Get the mutex used to serialize writing to @c cout.
 *
 * @return The mutex used to serialize writing to @c cout.
 */
inline static std::shared_ptr<std::mutex> getCoutMutex() {
        static std::shared_ptr<std::mutex> coutMutex(new std::mutex);
        return coutMutex;
}

#endif  // COUTMUTEX_H_

